package com.easy.service.impl;

import com.easy.bean.Product;
import com.easy.dao.CategoryDao;
import com.easy.dao.ProductDao;
import com.easy.service.ICategoryService;
import com.easy.service.IProductService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class ProductService implements IProductService {

    @Autowired
    ProductDao productDao;

    @Override
    public int addProduct(Product product) {
        return productDao.addProduct(product);
    }

    @Override
    public int editProduct(Product product) {
        return productDao.editProduct(product);
    }

    @Override
    public int deleteProduct(int productid) {
        return productDao.deleteProduct(productid);
    }

    @Override
    public List<Product> getList(Page page, String text) {
        return productDao.getList(page, text);
    }



    @Override
    public Product getProductById(int productid) {
        return productDao.getProductById(productid);
    }

    @Override
    public int getCount(String text) {
        return productDao.getCount(text);
    }
}
